<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>腾飞健康管理平台</title>
    <link rel="stylesheet" href="lib/layui/css/layui.css">
</head>
<body>
<div style="padding: 10px">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>基本信息</legend>
    </fieldset>
    <form class="layui-form  layui-form-pane">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="examinerName" placeholder="请输入员工姓名" autocomplete="off" class="layui-input"
                           lay-verify="required" disabled>
                </div>
                <label class="layui-form-label">工号</label>
                <div class="layui-input-inline">
                    <input type="text" name="examinerId" class="layui-input" disabled>
                </div>
            </div>

        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">身份证号</label>
                <div class="layui-input-inline">
                    <input type="text" name="idNumber" placeholder="请输入身份证号" autocomplete="off" class="layui-input"
                           lay-verify="required|identity" maxlength="18" disabled>
                </div>
                <label class="layui-form-label">民族</label>
                <div class="layui-input-inline">
                    <div name="nation">
                        <input type="text" name="nation" class="layui-input" disabled>
                    </div>
                    <!--<select name="nation" lay-verify="required">
                        <option value="">请选择</option>
                        <option value="汉族">汉族</option>
                    </select>-->
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">职称类别</label>
                <div class="layui-input-inline">
                    <div name="professionalType">
                        <input type="text" name="professionalType" class="layui-input" disabled>
                    </div>
                    <!--<select name="professionalType" lay-filter="professionalType">
                        <option value="">请选择</option>
                    </select>-->
                </div>
                <label class="layui-form-label">职称</label>
                <div class="layui-input-inline">
                    <div name="professionalTitle">
                        <input type="text" name="professionalTitle" class="layui-input" disabled>
                    </div>
                    <!--<select name="professionalTitleId" lay-filter="professionalTitle" disabled="disabled">
                        <option value="">请选择</option>
                    </select>-->
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">科室</label>
                <div class="layui-input-inline">
                    <input type="text" name="office" placeholder="请输入科室" autocomplete="off" class="layui-input"
                           lay-verify="required" disabled>
                </div>
                <label class="layui-form-label">职务</label>
                <div class="layui-input-inline">
                    <input type="text" name="duty" placeholder="请输入职务" autocomplete="off" class="layui-input" disabled>
                </div>
            </div>
        </div>
        <!--<div class="layui-form-item">
            <label class="layui-form-label">证件照</label>
            <div class="layui-input-block">
                <input type="text" name="picture" placeholder="请上传证件照" class="layui-input" lay-verify="required">
            </div>
        </div>-->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">学位</label>
                <div class="layui-input-inline">
                    <div class="degree">
                        <input type="text" name="degree" class="layui-input" disabled>
                    </div>
                    <!--<select name="degree" lay-verify="required">
                        <option value="">请选择</option>
                        <option value="无">无</option>
                        <option value="学士">学士</option>
                        <option value="硕士">硕士</option>
                        <option value="博士">博士</option>
                        <option></option>
                    </select>-->
                </div>
                <label class="layui-form-label">学校</label>
                <div class="layui-input-inline">
                    <input type="text" name="school" placeholder="请输入获得最高学历的学校" class="layui-input"
                           lay-verify="required" disabled>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">政治面貌</label>
                <div class="layui-input-inline">
                    <div name="politicStatus">
                        <input type="text" name="politicStatus" class="layui-input" disabled>
                    </div>
                    <!--<select name="politicStatus" lay-verify="required">
                        <option value="">请选择</option>
                        <option value="群众">群众</option>
                        <option value="中共党员">中共党员</option>
                        <option value="中共预备党员">中共预备党员</option>
                        <option value="共青团员">共青团员</option>
                        <option value="民革党员">民革党员</option>
                        <option value="民盟盟员">民盟盟员</option>
                        <option value="民建会员">民建会员</option>
                        <option value="民进会员">民进会员</option>
                        <option value="农工党党员">农工党党员</option>
                        <option value="致公党党员">致公党党员</option>
                        <option value="九三学社社员">九三学社社员</option>
                        <option value="台盟盟员">台盟盟员</option>
                        <option value="无党派人士">无党派人士</option>
                    </select>-->
                </div>
                <label class="layui-form-label">宗教信仰</label>
                <div class="layui-input-inline">
                    <div name="faith">
                        <input type="text" name="faith" class="layui-input" disabled>
                    </div>
                    <!--<select name="faith" lay-verify="required">
                        <option value="">请选择</option>
                        <option value="无">无</option>
                        <option value="佛教">佛教</option>
                        <option value="基督教">基督教</option>
                        <option value="伊斯兰教">伊斯兰教</option>
                    </select>-->
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">电话</label>
                <div class="layui-input-inline">
                    <input type="text" name="telephone" placeholder="请输入手机号码" autocomplete="off" class="layui-input"
                           lay-verify="required|phone" disabled>
                </div>
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-inline">
                    <input type="text" name="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input"
                           lay-verify="required|email" disabled>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">住址</label>
            <div class="layui-input-block">
                <input type="text" name="address" placeholder="请输入地址" autocomplete="off" class="layui-input"
                       lay-verify="required" maxlength="64" disabled>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">个人介绍</label>
            <div class="layui-input-block">
                <textarea name="description" placeholder="请输入内容" class="layui-textarea" style="position: relative"
                          maxlength="500"
                          onpropertychange="if(value.length>500) value=value.substr(0,500)"
                          oninput="wordLeg(this);" disabled></textarea>
                <div class="word">
                    <span class="text_count">0</span> / <span class="num_count" id="numCount">500</span>
                </div>
                <div style="margin-top: 20px"></div>
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>权限信息</legend>
        </fieldset>
        <div class="layui-form-item">
            <label class="layui-form-label">角色</label>
            <div class="layui-input-block">
                <input type="text" name="roleName" autocomplete="off" class="layui-input" maxlength="18" disabled>
            </div>
        </div>

        <!--<div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="registe">立即提交</button>
                <button class="layui-btn layui-btn-primary" name="edit">编辑</button>
            </div>
        </div>-->

    </form>
</div>

<script type="text/javascript" src="lib/layui/layui.js"></script>
<script>
    layui.use(["form", "layer", "jquery"], function () {
        let form = layui.form;
        let layer = layui.layer;
        let $ = layui.jquery;

        $(document).ready(function () {
            let loadIndex = null;
            $.ajax({
                url: "/getExaminerInfo",
                dataType: "json",
                type: "post",
                beforeSend: function () {
                    loadIndex = layer.load();
                },
                success: function(responseData){
                    layer.close(loadIndex);
                    for(let key in responseData){
                        if(key == "roleNames"){
                            $("input[name=roleName]").val(responseData[key]);
                        }else if(key == "examiner"){
                            $("input[name=examinerName]").val(responseData[key].examinerName);
                            $("input[name=examinerId]").val(responseData[key].examinerId);
                            $("input[name=idNumber]").val(responseData[key].idNumber);
                            $("select[name=professionalType]").val(responseData[key].professionalType);
                            $("select[name=professionalTitleId]").val(responseData[key].professionalTitleId);
                            $("input[name=office]").val(responseData[key].office);
                            $("input[name=duty]").val(responseData[key].duty);
                            $("input[name=degree]").val(responseData[key].degree);
                            $("input[name=school]").val(responseData[key].school);
                            $("input[name=telephone]").val(responseData[key].telephone);
                            $("input[name=email]").val(responseData[key].email);
                            $("input[name=address]").val(responseData[key].address);
                            $("textarea[name=description]").val(responseData[key].description);
                            $("input[name=politicStatus]").val(responseData[key].politicStatus);
                            $("input[name=faith]").val(responseData[key].faith)

                        }else if(key == "nation"){
                            $("input[name=nation]").val(responseData[key]);
                        }else if(key == "professional"){
                            $("input[name=professionalType]").val(responseData[key].professionalType);
                            $("input[name=professionalTitle]").val(responseData[key].professionalTitle);
                        }
                    }

                },
                error: function(){
                    layer.close(loadIndex);
                    layer.msg("服务器错误，请重试！", {icon: 2, time: 1000});
                },
            });
        })

        // form.on("submit(submitItem)", function (data) {
        //     console.log(data.field);
        //     $.ajax({
        //         url: "/submitAddCliExamineItem",
        //         data: data.field,
        //         dataType: "json",
        //         tyep: "post",
        //         success: function (responseResult) {
        //             let iconNum;
        //             if (responseResult.code == 1) {
        //                 iconNum = 1;
        //             } else {
        //                 iconNum = 2;
        //             }
        //             layer.msg(responseResult.msg, {
        //                 time: 1500,
        //                 icon: iconNum,
        //             });
        //         },
        //         error: function () {
        //             layer.msg("服务器错误！", {
        //                 icon: 2,
        //                 time: 1500,
        //             });
        //         }
        //     });
        //     return false;
        // });
    });

</script>
</body>
</html>